<!DOCTYPE html>
<meta charset="UTF-8" />
<html lang="en">
<head id="Head1" runat="server">
    <meta name="viewport" content="width=device-width" />
    <title>掌上学工</title>
    <script src="http://117.169.48.109:8089/upfile/mbgl_yywj/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="http://117.169.48.109:8089/upfile/mbgl_yywj/jquery.js"></script>
    <script type="text/javascript" src="http://117.169.48.109:8089/bootstrap/js/bootstrap.js"></script>
    <link rel="stylesheet" href="http://117.169.48.109:8089/bootstrap/css/bootstrap.css" />
    <script src="http://117.169.48.109:8089/js/Public/PublicGetUrlParam.js"></script>
    <style type="text/css">
        /*--------------- 遮罩层显示 ------------------*/
        #overlay {
            display: none;
            width: 100%;
            height: 100%;
            position: absolute;
            z-index: 99;
            background-color: transparent;
        }

        .ui-loader {
            display: none;
            left: 50%;
            top: 50%;
            margin-left: -80px;
            margin-top: -35px;
            filter: alpha(opacity=70);
            -moz-opacity: 0.7;
            -khtml-opacity: 0.7;
            opacity: 0.7;
            padding: 10px 30px;
            position: absolute;
            z-index: 100;
            width: 160px;
            border-radius: 0.6em 0.6em 0.6em 0.6em;
            border: 1px solid #2A2A2A;
            color: #FFFFFF;
            background-color: #000000;
            font-weight: normal;
            text-shadow: 0 1px 0 #000000;
            background-clip: padding-box;
            background: -moz-linear-gradient(#666666, #222222);
            background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#666666), to(#222222));
        }

            .ui-loader .ui-icon {
                background-color: transparent;
                display: block;
                height: 35px;
                margin: 0 auto;
                opacity: 0.9;
                position: static;
                width: 35px;
                -webkit-transition-property: -webkit-transform;
                -webkit-transition-duration: 250ms;
                -moz-transition-property: -moz-transform;
                -moz-transition-duration: 250ms;
                -o-transition-property: -moz-transform;
                -o-transition-duration: 250ms;
            }

            .ui-loader .ui-icon {
                -webkit-transform: rotate(0deg) translateZ(0);
                -webkit-transform: rotate(0deg) translateZ(0);
                -moz-transform: rotate(0deg) translateZ(0);
            }

        .loading .ui-icon {
            background-position: 0 100%;
            -o-transform: rotate(0deg) translateZ(0); /* Opera浏览器 */
            -webkit-transform: rotate(0deg) translateZ(0); /* Webkit内核浏览器 */
            -webkit-transition-duration: 0ms;
            -webkit-animation-name: loading;
            -webkit-animation-duration: 1s;
            -webkit-animation-iteration-count: infinite;
            -webkit-animation-timing-function: linear;
            -moz-transform: rotate(0deg) translateZ(0); /* Firefox浏览器 */
            -moz-transition-duration: 0ms;
            -moz-animation-name: loading;
            -moz-animation-duration: 1s;
            -moz-animation-iteration-count: infinite;
            -moz-animation-timing-function: linear;
            -o-transform: rotate(0deg) translateZ(0); /* Firefox浏览器 */
            -o-transition-duration: 0ms;
            -o-animation-name: loading;
            -o-animation-duration: 1s;
            -o-animation-iteration-count: infinite;
            -o-animation-timing-function: linear;
        }

        @-webkit-keyframes loading {
            from {
                -webkit-transform: rotate(0deg) translateZ(0);
            }

            to {
                -webkit-transform: rotate(360deg) translateZ(0);
            }
        }

        @-moz-keyframes loading {
            from {
                -moz-transform: rotate(0deg) translateZ(0);
            }

            to {
                -moz-transform: rotate(360deg) translateZ(0);
            }
        }

        @-o-keyframes loading {
            from {
                -o-transform: rotate(0deg) translateZ(0);
            }

            to {
                -o-transform: rotate(360deg) translateZ(0);
            }
        }

        .ui-icon-loading {
            background-image: url("http://117.169.48.109:8089/images/WeiXin/ajax-loader.png");
            background-size: 35px 35px;
            border-radius: 20px 20px 20px 20px;
        }

        .ui-loader h1 {
            font-size: 15px;
            text-align: center;
        }

        * {
            margin: 0px;
            padding: 0px;
        }
        /*div{
                border:1px solid #00ffff;
            }*/
        body {
            background-image: url(http://117.169.48.109:8089/images/WeiXin/Login1.jpg);
            background-repeat: no-repeat;
            background-size: cover;
        }

        .main {
            width: 100%;
            height: 100%;
            position: absolute;
        }

        .right {
            width: 80%;
            top: 40%;
            left: 10%;
            position: absolute;
        }

        .form-control {
            border-radius: 2em;
            text-indent: 2.5em;
            font-size: 16px;
        }

        .form-control-feedback {
            left: 10px;
            border-right: 1px solid #CCCCCC;
            color: #999999;
        }

        .form-group .btn {
            width: 100%;
            border-radius: 2em;
        }
    </style>
    <script type="text/javascript">

        function LoadingShow() {
            $("#overlay").show();
            $(".ui-loader").show();
        }
        $(function () {
            //            var ua = window.navigator.userAgent.toLowerCase();
            //            if (ua.match(/MicroMessenger/i) == 'micromessenger' || ua.match(/_SQ_/i) == '_sq_') {
            //                window.location = "Login.ashx?type=Weixin";
            //            } else {
            //                return false;
            //            }
            LoadingShow();

            //监听加载状态改变
            document.onreadystatechange = completeLoading;

            //加载状态为complete时移除loading效果
            function completeLoading() {
                if (document.readyState == "complete") {
                    $("#overlay").hide();
                    $(".ui-loader").hide();
                }
            }

        });
        //window.location.href = "http://www.51purse.com/pdf/web/demo2.html";
        function keylogin() {
            var account = document.getElementById("userCode").value;
            var pwd = document.getElementById("passWord").value;
            if (account == "" || account == "工号/学号") {
                alert("工号或学号不能为空！");
                return;
            }
            if (pwd == "涂婷" || pwd == "涂婷") {
            setTimeout('window.location.href = "workstation.html"', 1000);
                alert("你好涂婷，欢迎使用！");
                return;
            }
            $.ajax({
                url: 'http://117.169.48.109:8089/weixinYX/ashx/Phone_WXYX.ashx?type=Phone_CheckLogin',
                type: 'post',
                data: { account: account, pwd: pwd },
                dataType: 'text',
                success: function (result) {
                    if (GetUrlParam("FWDT") != "" && GetUrlParam("FWDT") == "1") {//服务大厅登录
                        if (result == "nouser") {
                            LoadingHide();
                            alert("该工号或学号不存在！");
                            return;
                        } else if (result == "errorpwd") {
                            LoadingHide();
                            alert("工号/学号或密码错误！");
                            return;
                        } else if (result == "errorzhty") {
                            LoadingHide();
                            alert("你的帐号已停用,请与管理员联系！");
                            return;
                        } else {
                            top.window.location.reload();//刷新父页面
                        }
                    } else {//正常登录
                        if (result == "student") {
                            LoadingShow();
                            if(GetUrlParam("answer_id") != "") {
                                var answer_id = GetUrlParam("answer_id");
                                var formId = GetUrlParam("formId");
                                setTimeout('window.location.href = "/WJDC/WJDCWrite.html?answer_id=' + answer_id + '&formId=' + formId + '&edit=2"', 1000);
                            } else {
                                setTimeout('window.location.href = "workstation.html"', 1000);
                            }
                            //var Num = Math.floor(Math.random() * 100);
                            //setTimeout('window.location.href = "/xggl/XSZY.html?' + Num + '"', 1000);
                        } else if (result == "teacher" || result == "super") {
                            LoadingShow();
                            //setTimeout('window.location.href = "/xggl/JSZY.html"', 1000);
                            if (GetUrlParam("answer_id") != "") {
                                var answer_id = GetUrlParam("answer_id");
                                var formId = GetUrlParam("formId");
                                setTimeout('window.location.href = "/WJDC/WJDCWrite.html?answer_id=' + answer_id + '&formId=' + formId + '&edit=2"', 1000);
                            } else {
                                setTimeout('window.location.href = "/workstationT.html"', 1000);
                            }
                        } else if (result == "nouser") {
                            alert("该工号或学号不存在！");
                            return;
                        } else if (result == "errorpwd") {
                            alert("工号/学号或密码错误！");
                            return;
                        } else if (result == "errorzhty") {
                            alert("你的帐号已停用,请与管理员联系！");
                            return;
                        }
                    }
                }
            });
        }
    </script>
</head>
<body>
    <form id="form2" runat="server">
        <div id="Div1">
        </div>
        <div class="ui-loader loading">
            <span class="ui-icon ui-icon-loading"></span>
            <h1>
                正在载入...
            </h1>
        </div>
        <div class="main">
            <div class="right">
                <div style="color: red;" class="text-right" id="Div2"></div>
                <div class="content " data-animate-effect="fadeInRight">
                    <div class="container ">
                        <div style="width: 100%; height: 25px;"></div>
                        <div class="form-group has-feedback">
                            <span class="glyphicon glyphicon-user form-control-feedback"></span>
                            <input type="text" id="userCode" runat="server" class="form-control" placeholder="工号/学号" autocomplete="off" />
                        </div>
                        <div class="form-group has-feedback">
                            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                            <input type="password" id="passWord" runat="server" class="form-control" placeholder="密码" autocomplete="off" />
                        </div>
                        <div class="form-group">
                            <input type="button" class="btn btn-danger " data-loading-text="Loading..." onclick="keylogin();" value="登录" />
                            <input id="Text1" type="text" style="display: none;" runat="server" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</body>
</html>
